home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / codelib2 / v_02_01 / 2n01048b < prev    next >
Encoding:
Text File  |  1995-11-01  |  255 b   |  19 lines

  1.  
  2.  
  3.  
  4. function search(var s : string) : integer;
  5.     var
  6.         i : integer;
  7.         found : boolean;
  8.     begin
  9.     found := false;
  10.     i := MAX;
  11.     while (i > 0) and (not found) do
  12.         if s = table[i] then
  13.             found := true
  14.         else
  15.             i := i - 1;
  16.     search := i;
  17.     end;
  18.  
  19.